package cn.tedu.mvcboot1.controller;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class BMIController {
    @RequestMapping("/bmi")
    @ResponseBody
    public String bmiController(double height,double weight){
            double result=weight/(height*height);
            if (result<18.5){
                return "偏瘦";
            }else if (result<24){
                return "正常";
            }else  if(result<27){
                return "微胖";
            }else {
                return "超胖";
            }

    }
}
